/*
 *  linux/arch/arm/mm/fault-armv.c
 *
 *  Copyright (C) 1995  Linus Torvalds
 *  Modifications for ARM processor (c) 1995-2002 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/mm.h>

#include <asm/cacheflush.h>

void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
{
	// unsigned long pfn = pte_pfn(pte);
	// struct address_space *mapping;
	// struct page *page;

// 	if (!pfn_valid(pfn))
// 		return;

// 	page = pfn_to_page(pfn);
// 	mapping = page_mapping(page);
// #ifndef CONFIG_SMP
// 	if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
// 		__flush_dcache_page(mapping, page);
// #endif
	// if (mapping) {
	// 	if (cache_is_vivt())
	// 		make_coherent(mapping, vma, addr, pfn);
	// 	else if (vma->vm_flags & VM_EXEC)
			__flush_icache_all();
	// }

	local_flush_tlb_all();
	flush_cache_all();
}
